package com.tai.algorithm;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/**
 * The type Test 5.
 *
 * @Desc : 给定n个字符串，请对n个字符串按照字典序排列。
 * @Author ： taylor
 * @Date ：2021/7/12 20:09
 */
public class Test5 {
    /**
     * The entry point of application.
     *
     * @param args the input arguments
     * @throws IOException the io exception
     */
    public static void main(String[] args) throws IOException {

        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int count = Integer.parseInt(bf.readLine());
        String[] result = new String[count];
        for (int i = 0; i < count; i++){
            result[i] = bf.readLine();
        }
        StringBuilder sb = new StringBuilder();
        Arrays.sort(result);
        for (String w : result){
            sb.append(w).append('\n');
        }
        System.out.println(sb.toString());
    }
}
